package com.token.utils;

import com.token.domain.SystemInfomation;
import lombok.extern.slf4j.Slf4j;
import oshi.SystemInfo;
import oshi.hardware.ComputerSystem;

import java.util.HashMap;
import java.util.Map;

@Slf4j
public class SystemInfoUtil {

    private static ComputerSystem computerSystem = new SystemInfo().getHardware().getComputerSystem();

    public static String getSystemSN() {
        return computerSystem.getSerialNumber();
    }

    public static String getBaseBoardSN() {
        return computerSystem.getBaseboard().getSerialNumber();
    }

    public static String getHardwareUUID() {
        return computerSystem.getHardwareUUID();
    }

    public static SystemInfomation getSystemInfo(){
        return SystemInfomation.builder()
                .systemSN(getSystemSN())
                .baseBoardSN(getBaseBoardSN())
                .hardwareUUID(getHardwareUUID())
                .build();
    }
}
